package com.jzr.medical.db1.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jzr.common.util.U;
import com.jzr.medical.db1.mapper.TDoctorMapper;
import com.jzr.medical.db1.model.TDoctor;
import com.jzr.medical.db1.service.DoctorService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DoctorServiceImpl extends ServiceImpl<TDoctorMapper, TDoctor> implements DoctorService {
    @Override
    public List<Map<String, Object>> codeList(String districtNo, String deptNo) {
        QueryWrapper<TDoctor> qw = new QueryWrapper<>();
        qw.select("id,code,name");
        qw.orderByAsc("name");
        qw.eq(U.isNotBlank(districtNo),TDoctor.DistrictCode_,districtNo)
                .eq(U.isNotBlank(deptNo),TDoctor.DeptCode_,deptNo);
        return listMaps(qw);
    }

}
